package wang.wangby.utils.monitor;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;


/**次数监控*/
public class CountMonitor implements Monitor{
	private  AtomicLong count=new AtomicLong(0);
	private String name;
	private Map map=new ConcurrentHashMap();
	public CountMonitor(String name){
		this.name=name;
		map.put(name, count);
	}
	
	public String toStr() {
		return name+"="+count.get();
	}
	
	public void increase(long delta){
		count.addAndGet(delta);
	}

	@Override
	public Map<String, Object> getReslut() {
		return map;
	}
	
}
